package component.fy.com.common_module.custom;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * Created by Administrator on 2015/12/4.
 */
public class MyCustomGridview extends GridView {

    public MyCustomGridview(Context context) {
        super(context);
    }

    public MyCustomGridview(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyCustomGridview(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int measure = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, measure);
    }

    @Override
    public int getNumColumns() {
        return 2;
    }
}
